/***********************************************************************************************//**
*\n  @file       main.c
*\n  @brief      主程序
*\n  @details
*\n -----------------------------------------------------------------------------------
*\n  文件说明：
*\n       1. 主程序
*\n
*\n -----------------------------------------------------------------------------------
*\n  版本:   修改人:       修改日期:        描述:
*\n  V0.01   罗先能        2021.4.8          创建
*\n
***************************************************************************************************/

/**************************************************************************************************
* 头文件
***************************************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
#include <libgen.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <net/if.h>

#include "hal.h"
#include "middleware.h"
#include "app.h"
#include "main.h"

#undef   DEBUG_LEVEL
#define  DEBUG_LEVEL  5
#include "vdebug.h"

/**************************************************************************************************
* 宏定义、结构定义
***************************************************************************************************/


/**************************************************************************************************
* 全局变量声明、定义
***************************************************************************************************/


/**************************************************************************************************
* 私有变量声明、定义
***************************************************************************************************/


/**************************************************************************************************
* 私有函数声明、定义
***************************************************************************************************/


/**************************************************************************************************
* 全局函数声明、定义
***************************************************************************************************/
int main(int argc, char *argv[])
{
#if 0
	printf("-----test gcc ---------------------------------------\n");
	printf("sizeof(long long) == %d\n", sizeof(long long));
	printf("sizeof(int)    == %d\n",  sizeof(int));
	printf("sizeof(long)   == %d\n",sizeof(long));
	printf("sizeof(void*)  == %d\n", sizeof(void*));
	printf("sizeof(float)  == %d\n", sizeof(float));
	printf("sizeof(double) == %d\n", sizeof(double));

	printf("__STDC__ == %d\n", __STDC__);
	printf("__STDC_HOSTED__ == %d\n", __STDC_HOSTED__);
	printf("__STDC_VERSION__ == %d\n", __STDC_VERSION__);
	printf("__FILE__ == %s\n", __FILE__);
	printf("__LINE__ == %d\n", __LINE__);
	printf("__DATE__ == %s\n", __DATE__);
	printf("__TIME__ == %s\n", __TIME__);

	debug_fatal (" debug_fatal()  color\n");
	debug_error (" debug_errror() color\n");
	debug_warn  (" debug_warn()   color\n");
	debug_info  (" debug_info()   color\n");
	debug_printf(" debug_printf() color\n");
	printf("-----test end --------------------------------------\n");
#endif

	printfColor(PCL_GREEN, "Version: %s \n\n", SOFTWARE_VERSION);


	int ret;
	ret = HalInit(argc, argv);
	ret = MiddleWareInit(argc, argv);
	ret = AppInit(argc, argv);

	ret = HalStart(argc, argv);
	ret = MiddleWarStart(argc, argv);
	ret = AppStart(argc, argv);

}


